#ifndef DPGLIB_H
#define DPGLIB_H
#include "DpgHeader.h"

FILE* safe_open(char* filename);
/*
 * safe_open : open safely a file and print error if not correctly open
 * argument : 
 * 	filename : file to open
 * return value :
 * 	NULL if not open 
 * 	a FILE* if correctly oppen
 */

DpgHeader read_header(char* filename);
/*
 * read_header : read the header of dpg file, stock all data and verify if it's okey
 * argument :
 * 	file : file to parse
 * return value : 
 * 	DpgHeader : struct with all data parsed
 */
void audio_video_extract(char* filename_audio, char* filename_video, DpgHeader* header);
/*
 * audio_video_extract : extract audio sinc and video sinc
 * arguments :
 * 	filename_audio : name of the extracted audio sinc
 * 	filename_video : name of the extracted video sinc
 * 	DpgHeader : struct contain file to copy and her data
 * return value :
 * 	none
 */


void dpg_convert(char* filename_output, DpgHeader* header);
 /*
 * dpg_convert : convert extracted sink into a containner
 * arguments :
 * 	filename_output : name of output filename
 * 	header : struct contain metadata of dpgfile.
 * return value :
 * 	none : error code stock on DpgHeader struct
 */
#endif
